//To do
//change Ogre to Cegui
//Search the functions that cegui use to load a progress bar

#ifndef LOADING_STATE_
#define LOADING_STATE_

#include "Ogre.h"
#include "OgreTextAreaOverlayElement.h"

class LoadingState
{
	public:
	LoadingState();
	~LoadingState();
	void enter();
	void update();
	void exit();
	void setProgress(Ogre::Real progress);
	/*-----------------------------------------------------------------------------
	| Gets the progress as a percentage.
	-----------------------------------------------------------------------------*/
	Ogre::Real getProgress()
	{
		return mProgress;
	}

			const Ogre::DisplayString& getCaption()
	{
		return mTextArea->getCaption();
	}

	void setCaption(const Ogre::DisplayString& caption)
	{
		mTextArea->setCaption(caption);
	}

	const Ogre::DisplayString& getComment()
	{
		return mCommentTextArea->getCaption();
	}

	void setComment(const Ogre::DisplayString& comment)
	{
		mCommentTextArea->setCaption(comment);
	}

	/*
	// Do not instantiate any widgets directly. Use SdkTrayManager.
	ProgressBar(const Ogre::String& name, const Ogre::DisplayString& caption, Ogre::Real width, Ogre::Real commentBoxWidth)
		: mProgress(0.0f)

	*/

	protected:

	Ogre::TextAreaOverlayElement*		mTextArea;
	Ogre::TextAreaOverlayElement*		mCommentTextArea;
	Ogre::OverlayElement*				mMeter;
	Ogre::OverlayElement*				mFill;
	Ogre::Real							mProgress;
};
/*
				ProgressBar* createProgressBar(TrayLocation trayLoc, const Ogre::String& name, const Ogre::DisplayString& caption,
			Ogre::Real width, Ogre::Real commentBoxWidth)
		{
			ProgressBar* pb = new ProgressBar(name, caption, width, commentBoxWidth);
			moveWidgetToTray(pb, trayLoc);
			return pb;
		}
*/

#endif